home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 2236 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: ux7.cso.uiuc.edu!djhoward
  2. From: djhoward@ux7.cso.uiuc.edu (howard daniel joseph)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Something goofy with fscanf(%s) ??
  5. Date: 29 Jan 1996 03:11:04 GMT
  6. Organization: University of Illinois at Urbana
  7. Message-ID: <4ehds8$o2g@vixen.cso.uiuc.edu>
  8. References: <4ee66r$ffk@vixen.cso.uiuc.edu> <MhW-x*ayf@yaps.rhein.de>
  9. NNTP-Posting-Host: ux7.cso.uiuc.edu
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Arno Eigenwillig (arno@yaps.rhein.de) wrote:
  13. : In article <4ee66r$ffk@vixen.cso.uiuc.edu>,
  14. :      I-am-unwilling-to-configure-my-newsreader writes:
  15.  
  16.     :)
  17.  
  18.     It works well enough ...
  19.  
  20. : >    Now what this says to me that when fscanf() hits the %22 in the string
  21. : > it's somehow interpreted funny and thus the second line is read back in as
  22. : > in the second line.
  23.  
  24. : fscanf() having problems with % would be rather strange. But how do
  25. : you do your output? Make sure you don't pass arbitrary strings as 2nd
  26. : argument to fprintf()...
  27.  
  28.     It's something along the lines of ...
  29.  
  30. fprintf(stream, "%d %s", int, string);
  31.  
  32.     (I forget the exact syntax ...)
  33.  
  34.     Also, the strings are created in a way that they will not contain 
  35. any spaces (output is stopped once input hits a space ...)
  36.  
  37.     I'm thinking to just take up the fgets() suggestion mentioned 
  38. earlier and then parse that. Just fscanf() is the quickest way ...
  39.  
  40. --
  41. =====///====================================================================
  42. ====///=======This message brought to you by dannyman@uiuc.edu==============
  43. \\\///=========HOME PAGE! http://www.uiuc.edu/ph/www/djhoward ==============
  44. =\XX/A1200==================================================================
  45.     My views are my own, and not those of my employer or UIUC. Happy Jim?
  46.